<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">
<html>
  <head>
  	<script type="text/javascript" src="../My97DatePicker/WdatePicker.js"></script>
    <base href="<%=basePath%>">
    <title>添加考试</title>
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<link rel="stylesheet" type="text/css" href="css/main.css" />
  </head>
  
  <body>
  	<%@ include file="header.jsp" %>
    
    <DIV id=tips>
		<P class=tips_left>
			您的位置：<A>首页</A> 
			&gt;&gt; <A>考试管理</A>
			&gt;&gt; <A>添加考试</A>
		</P>
	</DIV>
		
	<DIV id=container>
		<DIV id=list_left>
			<%@ include file="left_exam.jsp" %>
		</DIV>
		<DIV id=list_right>
			<DIV id=subnav>
				<UL class=subnav_ul1></UL>
				<UL class=subnav_ul2>
					<DIV class=subnav_t>
						<P class=subnav_tl>添加考试</P>
  						<P class=subnav_tr></P>
  					</DIV>
  					<DIV class=subnav_nr>
  						<form id="addNewExam" name="addNewExam" action="teacher/addNewExam.html" method="post">
							<table width="500" align="center" border="0" cellpadding="0" cellspacing="0">
								<tr>
									<td class="row_name" width="15%">标题：</td>
					                <td class="row_content" width="30%">
					                	<input type="text" name="title" value="${title}" />
					                </td>
					                <td class=error_message>* ${error_title}</td>
					            </tr>
								<tr>
					                <td class="row_name">考试科目：</td>
									<td class="row_content">
					            		<select name="subject">
					            			<option value="0"></option>
					            			<c:forEach items="${subjectList}" var="subject">
					            			<option value="${subject.id}" <c:if test="${subjectID == subject.id}">selected</c:if> >
					            				${subject.name}
					            			</option>
					            			</c:forEach>
					            		</select>
					                </td>
					                <td class=error_message>* ${error_subjectID}</td>
					            </tr>
								<tr>
					                <td class="row_name">开始时间：</td>
									<td class="row_content">
					            		<input type="text" name="start_time_str" value="${start_time_str}" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})"/>
									</td>
									<td class=error_message>* ${error_start_time}</td>
								</tr>
								<tr>
					                <td class="row_name">结束时间：</td>
									<td class="row_content">
					            		<input type="text" name="end_time_str" value="${end_time_str}" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})"/>
									</td>
									<td class=error_message>* ${error_end_time}</td>
								</tr>
								<tr>
					                <td class="row_name">考试班级：</td>
					                <td class="row_content">
					                	<c:forEach items="${banjiList}" var="banji">
					                		<c:set var="flag" value="0" />
											<c:forEach items="${banji_array}" var="banjiFormBack">
			 									<c:if test="${banjiFormBack == banji.id}">
			 										<c:set var="flag" value="1" />
												</c:if>
											</c:forEach>
					            			<input type="checkbox" name="banji" value="${banji.id}" <c:if test="${flag == 1}">checked</c:if> />${banji.name}
					            			<br/>
					            		</c:forEach>
									</td>
									<td class=error_message>* ${error_banji}</td>
					            </tr>
								<tr>
						          	<td class="row_name">备注：</td>
						          	<td class="row_content">
						          		<textarea name="remark" rows="4" cols="17">${remark}</textarea>
									</td>
									<td class=error_message>${error_remark}</td>
						        </tr>
						        <tr>
						          	<td class="row_name"></td>
						          	<td class="row_submit"><input type="submit" value=" 提 交 "></td>
						        </tr>
							</table>
					      </form>
					</DIV>
				</UL>
				<UL class=subnav_ul3></UL>
			</DIV>
		</DIV>
	</DIV>

    <%@ include file="../footer.jsp" %>
  </body>
</html>
